
<template>
	<el-dialog width="50%" visible :show-close="false" :modal-append-to-body="false" class="wrap" size="tiny">
			 <div class="bt">预览</div>
	<i class="el-icon-close close" @click="cancel" style="color: white;z-index: 99;"></i>
	<h1 style="width: 100%; text-align: center;">{{form.mc}}</h1>
		<ul>
			<li>
				<!--<el-rate style="float: right; margin-top: 7px;"></el-rate>-->
				<p>{{form.lx1}} </p> 
				<el-rate
				  v-model="defaultvalue"
				  show-text 
				  :show-text="false">
				</el-rate>
				<div style="margin-left: 30px;"><el-checkbox v-for="i in xq1">{{i}}</el-checkbox></div>
				<p>评价规则</p> 
				<div>
					{{form.pjgz}}
				</div>
			</li>
			<!--<li>
				<p>{{form.lx2}} </p>
				<div style="margin-left: 30px;"><el-checkbox v-for="i in xq2">{{i}}</el-checkbox></div>
			</li>
			<li>
				<p>{{form.lx3}}</p>
				<div style="margin-left: 30px;"><el-checkbox v-for="i in xq3">{{i}}</el-checkbox></div>
			</li>
			<li>
				<p>{{form.lx4}}</p>
				<div style="margin-left: 30px;"><el-checkbox v-for="i in xq4">{{i}}</el-checkbox></div>
			</li>
			<li>
				<p>{{form.lx5}}</p>
				<div style="margin-left: 30px;"><el-checkbox v-for="i in xq5">{{i}}</el-checkbox></div>
			</li>-->
		</ul>
		<div style="width: 100%; text-align: center;margin-top: 30px;">
			<el-button type="primary" class="submit" @click="cancel">确定</el-button>
		</div>
	</el-dialog>
</template>

<script type="text/javascript">
	import qs from 'qs'
	export default {
		props: ['params'],
		data() {
			return {
				defaultvalue:5,
				form: {
					 mc:'',
					 lx1:'',
					 lx2:'',
					 lx3:'',
					 lx4:'',
					 lx5:'',
					
					 note:'',
					 pjgz:'',
				},
				 xq1:[],
				 xq2:[],
				 xq3:[],
				 xq4:[],
				 xq5:[],
			}
		},
		created() {
           this.form.id=this.params.row.id;
			this.loadinfo();
		},
		methods: {
			loadinfo(){
 				 var logininfo = JSON.parse(localStorage.logininfo) ;
				         var params3 = qs.stringify({
				           xxid:logininfo.xxid,
				           yhid:logininfo.id,
				           id:this.form.id
						});
 				 this.axios.post(this.$store.state.api+'xspjlsmb/info',params3)
               .then( res =>  {
               	console.log(res,999888)
 							this.form=res.data.data
   							var nr1 = []
   							var nr2 = []
   							var nr3 = []
   							var nr4 = []
   							var nr5 = []
   							nr1 = res.data.data.xq1.split(" ");
   							for(var a in nr1){
   								if(nr1[a]){
   									this.xq1.push(nr1[a])
   								}
   							}
   							nr2 = res.data.data.xq2.split(" ");
   							for(var a in nr2){
   								if(nr2[a]){
   									this.xq2.push(nr2[a])
   								}
   							}
   							nr3 = res.data.data.xq3.split(" ");
   							for(var a in nr3){
   								if(nr3[a]){
   									this.xq3.push(nr3[a])
   								}
   							}
   							nr4 = res.data.data.xq4.split(" ");
   							for(var a in nr4){
   								if(nr4[a]){
   									this.xq4.push(nr4[a])
   								}
   							}
   							nr5 = res.data.data.xq5.split(" ");
   							for(var a in nr5){
   								if(nr5[a]){
   									this.xq5.push(nr5[a])
   								}
   							}
 					 }).catch(res => {
 						 this.$message.warning("服务器异常");
 			 				this.$emit('close', { type: 'info', cancel: true });
 					 })
 			},
			cancel() {
				this.$emit('close', { type: 'info', cancel: true })
			}
		}
	}
</script>

<style lang="less" scoped>
	.wrap {
		/*text-align: center;*/
	}
.bt{
			position: absolute;
			width: 100%;
			height: 50px;
			margin: 0 auto;
			top:0;
			left:0;
			background: #50BFFF;
			margin-bottom: 20px;
			color:white;
			text-align:left;
			line-height: 50px;
			font-size: 17px;
			padding-left: 15px;
		}
		ul{
			li{
				/*height:100px;*/
				line-height: 40px;
				p{	
					width: 30%;
					font-size: 20px;
				}
			}
		}
	
	.submit {
		width: 120px;
	}
</style>
